package cn.yangliu.operation.constant;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import cn.yangliu.operation.entity.DefaultOperation;

/**
 * @author 杨柳
 * 创建时间 2017-08-28 01:05
 */
public final class OperationConstant {

    public static final ExecutorService POOL = Executors.newFixedThreadPool(10);

    private OperationConstant() {
    }

    public static Class<?> ENTITY_CLASS = DefaultOperation.class;

    private static final ThreadLocal<String> OPERATION_THREAD_LOCAL = new ThreadLocal<>();

    public static String APPLICATION_NAME;

    public static boolean GLOBAL_RECORD_PARAMS = true;

    public static void setValue(String value) {
        OPERATION_THREAD_LOCAL.set(value);
    }

    public static String getValue() {
        String value = OPERATION_THREAD_LOCAL.get();
        OPERATION_THREAD_LOCAL.remove();
        return value;
    }

}
